/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package boundless.entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.validation.constraints.NotNull;

/**
 *
 * @author hendrikdekock
 */
@Embeddable
public class PlayerteamPK implements Serializable {
    @Basic(optional = false)
    @NotNull
    @Column(name = "PLAYERID")
    private int playerid;
    @Basic(optional = false)
    @NotNull
    @Column(name = "TEAMID")
    private int teamid;

    public PlayerteamPK() {
    }

    public PlayerteamPK(int playerid, int teamid) {
        this.playerid = playerid;
        this.teamid = teamid;
    }

    public int getPlayerid() {
        return playerid;
    }

    public void setPlayerid(int playerid) {
        this.playerid = playerid;
    }

    public int getTeamid() {
        return teamid;
    }

    public void setTeamid(int teamid) {
        this.teamid = teamid;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) playerid;
        hash += (int) teamid;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof PlayerteamPK)) {
            return false;
        }
        PlayerteamPK other = (PlayerteamPK) object;
        if (this.playerid != other.playerid) {
            return false;
        }
        if (this.teamid != other.teamid) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "boundless.entities.PlayerteamPK[ playerid=" + playerid + ", teamid=" + teamid + " ]";
    }
    
}
